package com.woniuxy.oldmanapi.mapper;

import com.woniuxy.oldmanapi.entity.Bed;
import com.woniuxy.oldmanapi.xvo.OABvo;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

import java.util.List;

@Repository
public interface BedMapper extends Mapper<Bed> {
    @Update("update bed set state = 0 where id = #{bid}")
    void updateBedStateById(int bid);
    List<OABvo> selectBedByRid(int roomId);

    List<OABvo> selectBedByRid0(int roomId);

    List<OABvo> selectBedByRid1(int roomId);

    int selectBedAccount(int state);
    @Select("select * from bed where room_id = #{id}")
    List<Bed> selectById(int id);
    @Select("select count(*) from bed where room_id = #{id}")
    int selectNum(int id);

    @Update("update bed set state = 1 where id = #{newbedId}")
    void updateBedStateByNewId(int newbedId);
}